<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My JSP 'input_hotel.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">

	<link rel="stylesheet" type="text/css" href="<c:url value="/css/application.css"></c:url>">
	<link rel="stylesheet" type="text/css" href="<c:url value="/css/form.css"></c:url>">
		
	<script type="text/javascript">
	   
	   function validate_required(field,alerttxt){
            with (field){
                 if (value==null||value=="")
                 {alert(alerttxt);return false}
                 else {return true}
              }
       }
	   
	   
	   function validate_form(thisform){
            with (thisform){
                 if (validate_required(hotelname,"分店名称为必填！")==false)
                     {hotelname.focus();return false}
                 if (validate_required(hoteladdress,"分店地址为必填！")==false)
                     {hoteladdress.focus();return false}
                 if (validate_required(hotelphone,"分店电话为必填！")==false)
                     {hotelphone.focus();return false}
                 if (validate_required(roomaccount,"房间总数为必填！")==false)
                     {roomaccount.focus();return false}
             }
        }

	</script>

  </head>
  
  <body>
   <form action="<c:url value="/HotelMgr"/>" onsubmit="return validate_form(this)"  method="post">
         <input type="hidden" name="act" value="create_hotel">
         <div class="headTitle">&gt;&gt;酒店分店</div>
         <div class="groupline" style="margin-bottom:5px">新增分店</div>
         <div>
              <ul>
                <li>
                   <span class="lableFont">分店名称：</span>
                   <input type="text" class="text" name="hotelname"size="40" value="${param['hotelname']}"/>
                </li>
                <li>
                   <span class="lableFont">分店地址：</span>
                   <input type="text" class="text" name="hoteladdress"size="40" value="${param['hoteladdress']}"/>
                </li>
                <li>
                   <span class="lableFont">分店电话：</span>
                   <input type="text" class="text" name="hotelphone"size="40" value="${param['hotelphone']}"/>
                </li>
                <li>
                   <span class="lableFont">房间总数：</span>
                   <input type="text" class="text" name="roomaccount"size="40" value="${param['roomaccount']}"/>
                </li>
              </ul>
         </div>
         <div class="submitDiv">
         <input type="submit" value="创建分店"/>
         <input type="reset" value="取消重写"/>
         </div>
     </form>
       <c:if test="${not empty errMsg}">
          <script type="text/javascript">
             alert("${errMsg}");
          </script>
       </c:if>
  </body>
  </body>
</html>
